package offer;


/**
 * @Auther: wangliuyang
 * @Date: 2021/4/23 21:34
 * @Description: 剑指 Offer 55 - I. 二叉树的深度
 */
public class Offer_55 {
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }else {
            return Math.max(maxDepth(root.left),maxDepth(root.right)) + 1;
        }
    }
}
